/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.gob.fonafe.dao.impl.stored;

import java.sql.Types;
import java.util.HashMap;
import java.util.Map;
import javax.sql.DataSource;
import oracle.jdbc.OracleTypes;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.SqlOutParameter;
import org.springframework.jdbc.core.SqlParameter;
import org.springframework.jdbc.object.StoredProcedure;
import pe.gob.fonafe.domain.BannerBean;
import pe.gob.fonafe.domain.PerfilBean;


public class ActualizaPerfilSP extends StoredProcedure{
    
    private static final String PROC_PARAM="USERADMIN.P_Actualiza_Perfil";
    
    public ActualizaPerfilSP(DataSource ds) {
        super(ds, PROC_PARAM);
        
        declareParameter(new SqlParameter("P_IDPERFIL", Types.VARCHAR));
        declareParameter(new SqlParameter("P_TIPOPERFIL", Types.VARCHAR));
        declareParameter(new SqlOutParameter("V_MENSAJE", Types.VARCHAR));
        declareParameter(new SqlOutParameter("V_EXITO", Types.VARCHAR));
        compile();
    }
    
    public Map execute(PerfilBean perfilBean){
        Map inputs = new HashMap();
        inputs.put("P_IDPERFIL", perfilBean.getId_perfil());
        inputs.put("P_TIPOPERFIL", perfilBean.getTipoPerfil());
        return super.execute(inputs);
    }
    
}
